﻿using System;

using SBPweb.Communication.Shared.Library.Contacts;

namespace SBPweb.Communication.Client.Library.Xmpp.Contacts
{

    partial class ContactPresenceState : ContactPresenceStateBase
    {

        #region Protected fields

        protected agsXMPP.protocol.client.Presence presence;

        #endregion

        #region Constructor logic

        internal ContactPresenceState(string statusMessage)
            : base(statusMessage)
        {
        }

        internal ContactPresenceState(AvailabilityTypes availability, string statusMessage)
            : base(availability, statusMessage)
        {
            presence = new agsXMPP.protocol.client.Presence((agsXMPP.protocol.client.ShowType)(int)availability, statusMessage);
        }

        internal ContactPresenceState(agsXMPP.protocol.client.Presence presence)
            : base((AvailabilityTypes)(int)presence.Show, presence.Status)
        {
            this.presence = presence;
        }

        #endregion
        
        #region Methods

        internal static agsXMPP.protocol.client.ShowType GetShowByAvailabilty(AvailabilityTypes availability)
        {
            return (agsXMPP.protocol.client.ShowType)(int)(availability);
        }

        #endregion

    }

}